<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>天书榜 | Top 10</title>
    <base href="${serverUri}"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/png" sizes="32x32" href="icon/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="icon/favicon-16x16.png">
    <link rel="stylesheet" href="admin/plugins/fontawesome-free/css/all.min.css">
    <link rel="stylesheet" href="css/ionicons/2.0.1/ionicons.min.css">
    <link rel="stylesheet" href="admin/plugins/datatables-bs4/css/dataTables.bootstrap4.css">
    <link rel="stylesheet" href="admin/plugins/sweetalert2-theme-bootstrap-4/bootstrap-4.min.css">
    <link rel="stylesheet" href="admin/css/adminlte.min.css">
    <link rel="stylesheet" href="css/mainpage.css">
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>
<body class="hold-transition layout-top-nav" style="background: #b3b3b3;">
<div class="wrapper">
    <nav class="main-header navbar navbar-expand navbar-white bg-gray-dark">
        <ul class="navbar-nav">
            <li class="nav-item">
                <span class="nav-link text-gray-dark rounded" style="background-color: #ffc107; cursor: pointer;" onclick="location.href='/';">
                    <i class="fas fa-home mr-1"></i>
                    <strong>
                        天书榜
                    </strong>
                </span>
            </li>
        </ul>

        <form class="form-inline ml-3">
            <div class="input-group input-group-sm">
                <input id="input-search-content" class="form-control form-control-navbar" type="search" placeholder="搜索小说名、作者" aria-label="Search">
                <div class="input-group-append">
                    <button class="btn btn-navbar" onclick="onSearchButtonClick();return false;">
                        <i class="fas fa-search text-white"></i>
                    </button>
                </div>
            </div>
        </form>

        <ul id="toppage-all-container" class="navbar-nav ml-5">
            <li class="nav-item dropdown">
                <a class="nav-link text-white" data-toggle="dropdown" href="#">总体数据排行<i class="fa fa-caret-down ml-2" aria-hidden="true"></i></a>
                <div class="dropdown-menu dropdown-menu-left bg-gray-dark text-white">
                    <#list rankCatlogList as row>
                        <a class="dropdown-item main-menu-item" href="${row[1]}">${row[0]}</a>
                    </#list>
                </div>
            </li>
        </ul>

        <ul id="toppage-top-container" class="navbar-nav ml-5">
            <li class="nav-item dropdown">
                <a class="nav-link text-white" data-toggle="dropdown" href="#">Top10<i class="fa fa-caret-down ml-2" aria-hidden="true"></i></a>
                <div class="dropdown-menu dropdown-menu-left bg-gray-dark text-white">
                    <#list rankCatlogList as row>
                        <a class="dropdown-item main-menu-item" href="${row[1]}">${row[0]}</a>
                    </#list>
                </div>
            </li>
        </ul>

        <ul id="toppage-help-container" class="navbar-nav ml-5">
            <li class="nav-item">
                <a class="nav-link text-white" href="#">帮助</a>
            </li>
        </ul>

        <ul class="navbar-nav ml-auto">
            <li class="nav-item dropdown" style="display: <#if isLogin> block <#else> none </#if> ;">
                <a class="nav-link" href="/usercenternotify">
                    <i class="far fa-bell text-white"></i>
                    <#if (unread > 0)>
                        <span class="badge badge-warning navbar-badge">${unread}</span>
                    </#if>
                </a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link" data-toggle="dropdown" href="#">
                    <i class="far fa-user text-white"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                    <div style="display: <#if isLogin> block <#else> none </#if> ;">
                        <a href="/usercenteraccount" class="dropdown-item">
                            <i class="fas fa-home mr-2"></i>个人中心
                        </a>
                        <div class="dropdown-divider"></div>
                        <a href="javascript:void(0);" class="dropdown-item" onclick="logout();">
                            <i class="fas fa-sign-out-alt mr-2"></i>登出
                        </a>
                    </div>
                    <div style="display: <#if isLogin> none <#else> block </#if> ;">
                        <a href="/login" class="dropdown-item">
                            <i class="fas fa-sign mr-2"></i>登录
                        </a>
                    </div>
                </div>
            </li>
        </ul>
    </nav>
    <div class="content-wrapper" style="width:1280px; margin: 0 auto;">
        <div class="row">
            <div class="col-10" style="border-right: 2px solid #88939e">
                <div class="content-header">
                    <div class="container-fluid">
                        <div class="row mb-2">
                            <div class="col-sm-6">
                                <div class="row">
                                    <h1 class="m-0 text-dark">Top 10</h1>
                                    <h6 class="ml-2 pt-2 text-info">(${type})</h6>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <section class="content">
                    <div class="row ml-2">
                        <div class="col-12">
                            <table>
                                <tbody>
                                <td>
                                    <h3 class="card-title">排名：
                                        <span id="indexFirst">
                                            <#if (contentList?size > 0)>
                                                1
                                            <#else>
                                                0
                                            </#if>
                                        </span> ~
                                        <span id="indexLast">
                                            ${contentList?size}
                                        </span>
                                    </h3>
                                </td>
                            </table>
                            <table id="fictionTable" class="table table-borderless table-striped table-hover border-top">
                                <thead>
                                <tr>
                                    <th><i class="fa fa-graduation-cap mr-2" aria-hidden="true"></i>序列</th>
                                    <th><i class="fa fa-book mr-2" aria-hidden="true"></i>书名</th>
                                    <th><i class="fa fa-file-image mr-2" aria-hidden="true"></i>类型</th>
                                    <th><i class="fa fa-user mr-2" aria-hidden="true"></i>作者</th>
                                    <th><i class="fa fa-flag mr-2" aria-hidden="true"></i>评分</th>
                                    <th><i class="fa fa-heart mr-2" aria-hidden="true"></i>收藏</th>
                                    <th><i class="fa fa-file mr-2" aria-hidden="true"></i>详情</th>
                                </tr>
                                </thead>
                                <tbody>
                                <#list contentList as row>
                                    <tr fictionid="${row[0]}" style="cursor: pointer; height: 80px;" onclick="topPageOnFictionClick(this);">
                                        <td style="vertical-align: middle;"><span class="ml-4">${row[6]}</span></td>
                                        <td style="vertical-align: middle;">${row[1]}</td>
                                        <td style="vertical-align: middle;">${row[2]}</td>
                                        <td style="vertical-align: middle;">${row[3]}</td>
                                        <td style="vertical-align: middle;">
                                            <strong>${row[4]}</strong>
                                        </td>
                                        <td style="vertical-align: middle;">
                                            <#if row[5] == "true">
                                                <i class="fa fa-heart ml-3 collect-enable" aria-hidden="true" onclick="topPageOnCollectClick(this);"></i>
                                            <#else>
                                                <i class="fa fa-heart ml-3 collect-disable" aria-hidden="true" onclick="topPageOnCollectClick(this);"></i>
                                            </#if>
                                        </td>
                                        <td style="vertical-align: middle;">
                                            <a href="/fiction/${row[0]}" class="ml-3"><i class="fa fa-eye mr-2 text-success" aria-hidden="true"></i></a>
                                        </td>
                                    </tr>
                                </#list>
                            </table>
                        </div>
                    </div>
                </section>
            </div>
            <div class="col-2">
                <h5 class="ml-3" style="margin-top: 5.4rem;">其他Top10</h5>
                <table class="ml-3">
                    <tbody>
                    <#list catlogList as row>
                        <tr style="height: 35px;"><td><a href="${row[1]}">${row[0]}</a></td></tr>
                    </#list>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <footer class="main-footer bg-gray-dark">
        <span> &copy; ${year2year} <strong><a href="http://tianshubang.com">tianshubang.com</a></strong> 版权所有 (v 1.0.1)</span>
        <span class="ml-2 mr-2 text-gray">|</span>
        <a href="/articlerepository"><u class="text-gray">小说索引</u></a>
        <span class="ml-2 mr-2 text-gray">|</span>
        <a href="/authorrepository"><u class="text-gray">作者索引</u></a>
    </footer>

</div>
<script src="admin/plugins/jquery/jquery.min.js"></script>
<script src="admin/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="admin/plugins/datatables/jquery.dataTables.js"></script>
<script src="admin/plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
<script src="admin/plugins/sweetalert2/sweetalert2.min.js"></script>
<script src="admin/js/adminlte.min.js"></script>
<script src="utility.js"></script>
<script src="script/page/toppage.js"></script>
</body>
</html>
